"""
I	1
V	5
X	10
L	50
C	100
D	500
M	1000
"""
# class Solution:
#     def intToRoman(self, num: int) -> str:
#         list1=['','M','MM','MMM']
#         list2=['','C','CC','CCC','CD','D','DC','DCC','DCCC','CM']
#         list3=['','X','XX','XXX','XL','L','LX','LXX','LXXX','XC']
#         list4=['','I','II','III','IV','V','VI','VII','VIII','IX']
#         return list1[num//1000]+list2[num%1000//100]+list3[num%100//10]+list4[num%10]


class Solution():
    def intToRoman(self, num: int) -> str:
        str=''
        list1=[(1000,'M'),(900,'CM'),(500,'D'),(400,'CD'),(100,'C'),(90,'XC'),(50,'L'),
        (40,'XL'),(10,'X'),(9,'IX'),(5,'V'),(4,'IV'),(1,'I')]
        for n,i in list1:
            while(num>=n):
                num -=n
                str+=i;
        return str






lll=Solution()
print(lll.intToRoman(1456))
